{% extends "participants/participantsbase.html" %}
{% load files %}
{% block content %}
    <table border="0" class="user_table">
    {% if Users %}
    {% regroup Users by status as Users %}
    {% for group in Users %}
	<tr><th><h2>{{group.grouper|lower|capfirst}}{{group.list|pluralize}}</h2></th><th colspan="100%" class="fullwidth"></th></tr>
	{% for user in group.list %}
	    {% if not forloop.counter|divisibleby:2 %}<tr><td></td>{% endif %}
		    {% if user.status == "INSTRUCTOR" or user.status == "ASSISTANT" or course.show_student_avatars and user.status == "STUDENT" %}
		    {% get_file_list for user.user as Files %}
		    <td class="right_justify"><img src="{% if Files.avatar %}{{Files.avatar.url}}{% else %}{{STATIC_URL}}images/BlankAvatar.png{% endif %}" height="75"></td>
		    {% endif %}
		    <th class="left_justify">
				<a href="{% course_url apps.participants.views.view_profile user.user.username %}">{{user.user.last_name|spacify}},&nbsp;{{user.user.first_name|spacify}}</a>
				{% if user.email %}<br>&nbsp;&nbsp;(<a href="{% course_url apps.contact.views.contact user.user.username %}">Email</a>){% endif %}
			</th>
	    {% if forloop.counter|divisibleby:2 %}</tr>{% endif %}
	{% endfor %}
    {% endfor %}
    {% endif %}
    </table>
{% endblock content %}